<!DOCTYPE html>
<html lang="en">
<body class="no-skin">




<div class="main-container ace-save-state" id="main-container2">

    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <!-- 
				<div class="page-header">
					
				</div>--><!-- /.page-header -->
				

				
				
				<div class="row">
					<div class="col-sm-12">
					
								<div class="widget-box">
									<div class="widget-header widget-header-blue widget-header-flat">
										<h4 class="widget-title lighter">
											受惠贫困户列表
										</h4>
										<div class="hidden" >
											<input class="col-xs-12 col-sm-10" type="text" id="form-field-projectId" name="projectId" value="$!{aidProjectPO.projectId}" />
										
										</div>
										
									</div>

									<div class="widget-body">
										<div class="widget-main">
											
											<div class="row">
												<div class="col-sm-12">
													<div class="col-xs-4">
														<label class="lineH-34 col-sm-4 control-label no-padding-right" for="checkedform-field-2"> 镇(乡) </label>
														<div class="col-sm-8">
															<select class="chosen-select form-control" name="townId" id="checkedform-field-2" data-placeholder="镇(乡)">
																<option value="">全部</option>
																#foreach($townInfoPO in $townInfoPOList)
																<option value="$!{townInfoPO.townId}">$!{townInfoPO.townName}</option>
																#end
															</select>
														</div>
													</div>
													<div class="col-xs-4 col-sm-4">
														<label class="lineH-34 col-sm-4 control-label no-padding-right" for="checkedform-field-1"> 贫困户名 </label>
														<div class="col-sm-8">
															<input type="text" id="checkedform-field-1" name="personName" placeholder="请输入户主名称" class="col-xs-10 col-sm-12" />
														</div>
													</div>
													<div class="col-xs-4 col-sm-4">
														
														<span class="input-group-btn" style="text-align: center;">
															<button type="button" class="btn btn-sm btn-primary" id="checked-pkh-list-btn">
																<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
																查询
															</button>
														</span>
														
													</div>
												</div>
											</div>
											<div class="row">
												<div class="col-sm-12">
													
													
													<div class="col-sm-12" style="overflow-x:auto">
														<table id="checked-pkh-list"></table>
														<div id="checked-pkh-list-pager"></div>
													</div>
												</div>
											</div>
											
											
											
											
										</div><!-- /.widget-main -->
									</div><!-- /.widget-body -->
								</div>
				
					</div>
				</div>
				
				
				
				<div class="hr hr4 hr-dotted"></div>
				
				
				<!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div>
</div>


		<!-- 待选贫困户列表 -->
		<script type="text/javascript">

			var widget_header = $(".widget-header");
			//resize to fit page size
			$(window).on('resize.jqGrid', function () {
				//$("#checked-pkh-list").jqGrid( 'setGridWidth', widget_header.width()-24 );
		    });
			
			function reloadDatacheckedGrid(){
				$("#checked-pkh-list").jqGrid('setGridParam',{  
					datatype:'json',  
					mtype : 'POST',
					postData:{'personName':$("#checkedform-field-1").val(),
						'townId':$("#checkedform-field-2").val(),
						'projectId':$("#form-field-projectId").val()}, //发送数据  
					page:1  
				}).trigger("reloadGrid"); //重新载入  
			}
			
			$('#checked-pkh-list-btn').on('click', function() {
				console.log('dddddd');
				reloadDatacheckedGrid();
			});
			
			

			function detailClick_pkh(rowid,villageId,familyId){
				
				//$("#pkhDetailModal").empty();
				//window.open("$!webPath/fpgzvillage/familyDetail?villageId="+villageId+"&familyId="+familyId); 
				//<div class="modal-dialog modal-lg " ><div class="modal-content" style="height: 600px;overflow: auto;"><div class="modal-header hide"></div><div class="modal-body center " ><div style="clear:both"></div><div style="height:400px;"><div class="fp-loading"><i class="fa fa-spinner fa-pulse fa-3x"></i><p>数据加载中，请耐心等待</p></div></div></div><div class="modal-footer hide"></div></div></div>
				//console.log("清空模态详情");
				$('#pkhDetailModal').children().remove(); 
				//console.log("显示加载信息...");
				$('#pkhDetailModal').append('<div class="modal-dialog modal-lg " ><div class="modal-content" style="height: 600px;overflow: auto;"><div class="modal-header hide"></div><div class="modal-body center " ><div style="clear:both"></div><div style="height:400px;"><div class="fp-loading"><i class="fa fa-spinner fa-pulse fa-3x"></i><p>数据加载中，请耐心等待</p></div></div></div><div class="modal-footer hide"></div></div></div>'); 
				//console.log("加载模态详情")
				$('#pkhDetailModal').modal({keyboard:false,backdrop:true,remote:"$!webPath/fpgzvillage/familyDetail?villageId="+villageId+"&familyId="+familyId});
			};
			$("#checked-pkh-list").jqGrid({
						url : '$!webPath/basicData/qryFamilyInfo?isInclude=true',
						datatype : "json",
						height : 520,
						shrinkToFit:false,  
						autoScroll: true, 
						//autowidth: true,
						colNames : [  'id','镇(乡)','行政村','户编号','贫困户名', '脱贫状态'],
						colModel : [ 
							{name : 'familyId',key:true,hidden:true}, 
							{name : 'townName',index : 'townName',sortable : false},
							{name : 'villageName',index : 'villageName',sortable : false},
							{name : 'familyCode',index : 'familyCode',sortable : false},
							{name : 'personName',index : 'personName',sortable : false},
							{name : 'povertyStateName',index : 'povertyStateName',sortable : false}
						],
						mtype : 'POST',
						postData: {    
							'personName':$("#checkedform-field-1").val(),
							'townId':$("#checkedform-field-2").val(),
							'projectId':$("#form-field-projectId").val()  
					    },
						jsonReader : {
							root : "resultList",
							page : "page",
							total : "totalPages",
							records : "totalRecords",
							rows : "resultList"
						},
						rowNum:10,
						rowList:[10,20,50,100],
						pager: '#checked-pkh-list-pager',
						sortname : 'familyId',
						viewrecords : true,
						sortorder : "desc",
						loadComplete : function() {
							var table = this;
							setTimeout(function(){
								styleCheckbox(table);
								
								updateActionIcons(table);
								updatePagerIcons(table);
								enableTooltips(table);
							}, 0);
							
							$(table).siblings(".norecords").remove(); 
							var rowNum = parseInt($(table).getGridParam("records"), 10);   
						    if (rowNum <= 0) {   
								$(table).parent().append("<div  class=\"norecords\">没有数据...</div>");
								$(table).siblings(".norecords").show(); 								
						    } 
						},

						multiselect : false
				});
			
			$("#checked-pkh-list").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "scroll" });
			
		</script>

		

		
		
		

</body>
</html>
